﻿<div class="content-item-ajax-result">
    <div id="content-search" style="margin-bottom: 10px;">
        <input type="text" id="contentSearchQuery" placeholder="Enter Search Term" style="width: 100% !important;" value="@Model.SearchTerm"/>
    </div>

    @if (Model.ContentItems.Count == 0)
    {
        if (string.IsNullOrEmpty(Model.SearchTerm))
        {
            <div style="font-size: 12px; font-style:italic; color:#777;">Please enter a search term and hit enter.</div>
        }
        else        
        {
            <div>Your search producted no results.</div>
        }
    }
    else
    {
        foreach (var contentItem in Model.ContentItems)
        {
            var title = @contentItem.Title;
            if (title.Length > 27)
            {
                title = title.Substring(0, 27) + "...";
            }

             <input name="MenuItem.ContentItemAdd.@(contentItem.Id)" id="MenuItem_ContentItemAdd_@(contentItem.Id)" value="@(contentItem.Id)" type="checkbox" class="check-box" title="@(contentItem.Title)"/>
             <label for="MenuItem_ContentItemAdd_@(contentItem.Id)" class="forcheckbox" title="@(contentItem.Title)">@title</label>
             <br />
        }

        <div style="margin-top: 20px;">
            @Display(Model.Pager)
        </div>
    }
</div>